home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / konq_pixmapprovider.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.4 KB  |  82 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
  3.  
  4.    This program is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; see the file COPYING.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.    Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef KONQ_PIXMAPPROVIDER_H
  21. #define KONQ_PIXMAPPROVIDER_H
  22.  
  23. #include <qmap.h>
  24.  
  25. #include <kpixmapprovider.h>
  26. #include "konq_faviconmgr.h"
  27.  
  28. #include <libkonq_export.h>
  29.  
  30. class KConfig;
  31.  
  32. class LIBKONQ_EXPORT KonqPixmapProvider : public KonqFavIconMgr, virtual public KPixmapProvider
  33. {
  34. public:
  35.     static KonqPixmapProvider * self();
  36.  
  37.     virtual ~KonqPixmapProvider();
  38.  
  39.     /**
  40.      * Looks up a pixmap for @p url. Uses a cache for the iconname of url.
  41.      */
  42.     virtual QPixmap pixmapFor( const QString& url, int size = 0 );
  43.  
  44.     /**
  45.      * Loads the cache to @p kc from the current KConfig-group from key @p key.
  46.      */
  47.     void load( KConfig * kc, const QString& key );
  48.     /**
  49.      * Saves the cache to @p kc into the current KConfig-group as key @p key.
  50.      * Only those @p items are saved, otherwise the cache would grow forever.
  51.      */
  52.     void save( KConfig *, const QString& key, const QStringList& items );
  53.  
  54.     /**
  55.      * Clears the pixmap cache
  56.      */
  57.     void clear();
  58.  
  59.     /**
  60.      * Looks up an iconname for @p url. Uses a cache for the iconname of url.
  61.      * @since 3.4.1
  62.      */
  63.     QString iconNameFor( const QString& url );
  64.  
  65. protected:
  66.     KonqPixmapProvider( QObject *parent=0, const char *name=0 );
  67.  
  68.     /**
  69.      * Overridden from KonqFavIconMgr to update the cache
  70.      */
  71.     virtual void notifyChange( bool isHost, QString hostOrURL, QString iconName );
  72.  
  73.     QPixmap loadIcon( const QString& url, const QString& icon, int size );
  74.  
  75. private:
  76.     QMap<QString,QString> iconMap;
  77.     static KonqPixmapProvider * s_self;
  78. };
  79.  
  80.  
  81. #endif // KONQ_PIXMAPPROVIDER_H
  82.